import { Component, OnInit, ViewChild, OnDestroy, AfterContentInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { NzMessageService, UploadFile, NzModalService, NzNotificationService } from 'ng-zorro-antd';
import { catchError } from 'rxjs/operators';
import { of } from 'rxjs';
import { ActivatedRoute, Router } from '@angular/router';
import {SettingsService, TitleService} from '@delon/theme';
import { Constant, ServiceResult } from '@core/constant';
import { maService } from '../../../../service/ma/ma.service';
import { EmitterService } from 'app/service/emit.service';
import { CommService } from '../../../../service/comm/comm.service';
import {insService} from "../../../../service/ins/ins.service";
import {ProductService} from "../../../../service/prod/product.service";
import {SimpleTableColumn, SimpleTableComponent} from "@delon/abc";
import {spListService} from "../../../../service/spList/spList.service";

@Component({
  selector: 'jyxq-list',
  templateUrl: './jyxq-list.component.html',
  styleUrls: ['./jyxq-list.component.less']
})
export class jyxqListComponent implements OnInit, OnDestroy {
  product:  any = {
    id:null,
    carNo: null,
    frameno:null
  };

  checkedList = [];

  @ViewChild('st') st: SimpleTableComponent;
  columns: SimpleTableColumn[] = [
    // { title: '', index: 'key', type: 'checkbox',exported:false },
    { title: '检验编号', index: 'qmCode' },
    { title: '检验项目', index: 'qmName' },
    { title: '不良品数量', index: 'qmBlpquantity' }


  ];
  loading = false;
  constructor(
    private productService: ProductService,

    public setting: SettingsService,
    private msg: NzMessageService,
    private modalService: NzModalService,
    private maService: maService,
    private emit: EmitterService,
    private notice: NzNotificationService,
    private route: ActivatedRoute,
    private titleService: TitleService,
    private cnt: Constant,
    private router: Router,
    private comm: CommService,
    private spListService: spListService,

  ) {}
  ps=1000;
  q: any = {
    buseid: '',
  };




  private sub: any;
url="";
  ngOnInit(): void {
    // 获取参数
    this.sub = this.route.params.subscribe(params => {
      this.q.buseid = params["id"];

      // 获取商品详情
              this.url=this.spListService.listjyxq(this.q.buseid);
    });
    // 隐藏reusetab
    // setTimeout(() => {
    //   this.emit.sendMessage("HIDE_REUSE_TAB");
    // }, 100);
    // this.titleService.setTitle("物料凭证")

  }

  // 显示reusetab
  ngOnDestroy() {
    this.emit.sendMessage("SHOW_REUSE_TAB");
  }
  back() {
    this.router.navigate(['/fhList/fhList']);
  }
  checkboxChange(list: any[]) {
    this.checkedList = list;
  }

}
